<?php
class SF_Vendordiscount_Block_Adminhtml_Vendordiscount_Edit extends Mage_Adminhtml_Block_Widget_Form_Container{
	public function __construct()
    {
        parent::__construct();
                 
        $this->_objectId   = 'id';
        $this->_blockGroup = 'vendordiscount';
        $this->_controller = 'adminhtml_vendordiscount';
        
        $this->_updateButton('save', 'label', Mage::helper('vendordiscount')->__('Save Item'));
        $this->_updateButton('delete', 'label', Mage::helper('vendordiscount')->__('Delete Item'));
		
        $this->_addButton('saveandcontinue', array(
            'label'     => Mage::helper('adminhtml')->__('Save And Continue Edit'),
            'onclick'   => 'saveAndContinueEdit()',
            'class'     => 'save',
        ), -100);
 
        $this->_formScripts[] = "
            
 
            function saveAndContinueEdit(){
                editForm.submit($('edit_form').action+'back/edit/');
            }
        ";
    }
 
    public function getHeaderText()
    {
        if( Mage::registry('vendordiscount_data') && Mage::registry('vendordiscount_data')->getId() ) {
            return Mage::helper('vendordiscount')->__("Edit Item");
        } else {
            return Mage::helper('vendordiscount')->__('Add Item');
        }
    }
}
// function toggleEditor() {
//                 if (tinyMCE.getInstanceById('vendordiscount_content') == null) {
//                     tinyMCE.execCommand('mceAddControl', false, 'vendordiscount_content');
//                 } else {
//                     tinyMCE.execCommand('mceRemoveControl', false, 'vendordiscount_content');
//                 }
//             }